import com.beans.Component;
import com.beans.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.jws.soap.SOAPBinding;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-17
 * Time: 19:19
 */
public class App2 {
    public static void main(String[] args) {
        // 1. 先获取上下文
        ApplicationContext context =
                new ClassPathXmlApplicationContext("spring-config.xml");
        // 2. 获取到 Bean
        User user = context.getBean("a", User.class);
        User user1 = context.getBean("b", User.class);
        // 3. 使用 Bean
        System.out.println(user);
        System.out.println(user1);

    }
}
